package com.hera.process.config.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.hera.base.dao.repository.BaseRepository;
import com.hera.process.workflow.domain.Swimlane;
import com.hera.process.workflow.domain.SwimlanePK;

public interface SwimlaneDao extends BaseRepository<Swimlane, SwimlanePK> {

	@Query("select entity from Swimlane entity where entity.swimlanePK.idProcess = ?")
	List<Swimlane> findSwimlaneByProcessId(Long idProcess);
	
	@Modifying
	@Transactional
	@Query("delete from Swimlane o where o.swimlanePK.idProcess = ?")
	void deleteByProcess(Long idProcess);
	
	
}
